# 使用不同的 HTTP 方法请求单个状态码
import requests

def request_status(method, code):
    url = f"https://httpbin.org/status/{code}"
    method = method.upper()  # 确保方法名为大写
    try:
        response = requests.request(method, url)
        print(f"Method: {method}, URL: {url}")
        print(f"Response Status Code: {response.status_code}")
    except requests.RequestException as e:
        print(f"Error for {method} {url}: {e}")

# 测试单个状态码 200 使用不同方法
methods = ["GET", "POST", "PUT", "PATCH", "DELETE"]
for method in methods:
    request_status(method, 200)
